import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";

import "./assets/newfonts/iconfont.css";
import "./assets/css/global.css";
import axios from "axios";

Vue.use(ElementUI);
Vue.config.productionTip = false;

axios.defaults.baseURL = "http://www.wuhaijun888.com:8888/api/private/v1/";

Vue.prototype.$http = axios;

axios.interceptors.request.use(
  (config) => {
    config.headers.Authorization = window.sessionStorage.token;
    return config;
  },
  (error) => {
    return Promise.reject(error);
  }
);

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");
